import cv2
import numpy as np

img = cv2.imread("./lena.jpg")
cv2.imshow("lena", img)

#R、G、B分量的提取
(B,G,R) = cv2.split(img)#提取R、G、B分量
cv2.imshow("Red",R)
cv2.imshow("Green",G)
cv2.imshow("Blue",B)

#HSV空间
hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
cv2.imshow("HSV",hsv)


#lab空间
lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
cv2.imshow("L*a*b*", lab)

cv2.waitKey(0)
cv2.destroyAllWindows()
